package com.zjuh.taofood.biz.dao.ibatis;

import com.zjuh.taofood.biz.dao.UserDAO;
import com.zjuh.taofood.biz.domain.UserDO;

public class UserDAOIbatis extends BaseIbatisDAO implements UserDAO {

	public int create(UserDO userDO) {
		return (Integer)this.getSqlMapClientTemplate().insert("UserDAO.create", userDO);
	}
	
	public void delete(int id) {
		this.getSqlMapClientTemplate().update("UserDAO.delete", id);
	}
	
	public void update(UserDO userDO) {
		this.getSqlMapClientTemplate().update("UserDAO.update", userDO);
	}
	
	public UserDO queryById(int id) {
		return (UserDO)this.getSqlMapClientTemplate().queryForObject("UserDAO.queryById", id);
	}

	@Override
	public UserDO queryByName(String name) {
		return (UserDO)this.getSqlMapClientTemplate().queryForObject("UserDAO.queryByName", name);
	}
	
}
